<?php

/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2019/11/5
 * Time: 13:27
 */
namespace app\api\controller;

//导出
class Export extends Base
{
    function __construct()
    {
        ignore_user_abort(true);
        set_time_limit(0);
        ini_set('memory_limit', '128M');

    }

    /**
     * @name Netfilter日志导出
     * @author wx
     * @date 2019/11/5 16:58
     */
    public function netfilterLog()
    {
        //接收参数
        $data['id'] = input('post.id');
        $data['module'] = input('post.module');

        $info = db('server_download')->where($data)->where('status','in', [0,1])->find();
        if(!$info){
            echo '无相关任务';
            die;
        }

        $server = new \app\api\service\Export();
        $server->netfilterLog($info);
    }

    public function rule()
    {
        //接收参数
        $data['id'] = input('post.id');
        $data['module'] = input('post.module');

        $info = db('server_download')->where($data)->where('status','in', [0,1])->find();

        if(!$info){
            echo '无相关任务';
            die;
        }

        $server = new \app\api\service\Export();
        $server->rule($info);
    }
}